From ab431f17dc9714f996ec3c23dbaec3a2a21433e8 Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Sat, 14 Jul 2012 17:07:38 +0200 Subject: [PATCH] babl: don't write anything if dest model lacks a source component otherwise converting cairo-RGB24 to R'G'B' overwrites the red component with the PAD. --- babl/babl-fish-reference.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/babl/babl-fish-reference.c b/babl/babl-fish-reference.c index b00d67d..56eeb16 100644 --- a/babl/babl-fish-reference.c +++ b/babl/babl-fish-reference.c @@ -133,14 +133,14 @@ convert_to_double (BablFormat *source_fmt, { dst_img->data[0] = source_double_buf + (dst_img->type[0]->bits / 8) * j; + + babl_process (assert_conversion_find (src_img->type[0], + dst_img->type[0]), + src_img, dst_img, n); break; } } - babl_process ( - assert_conversion_find (src_img->type[0], dst_img->type[0]), - src_img, dst_img, - n); src_img->data[0] += src_img->type[0]->bits / 8; } babl_free (src_img); @@ -187,14 +187,14 @@ convert_from_double (BablFormat *destination_fmt, { src_img->data[0] = destination_double_buf + (src_img->type[0]->bits / 8) * j; + + babl_process (assert_conversion_find (src_img->type[0], + dst_img->type[0]), + src_img, dst_img, n); break; } } - babl_process ( - assert_conversion_find (src_img->type[0], dst_img->type[0]), - src_img, dst_img, - n); dst_img->data[0] += dst_img->type[0]->bits / 8; } babl_free (src_img); -- 2.30.2